﻿namespace Numbrella.Client
{
	using System.Windows;
	using Numbrella.Client.Common;
	
	public partial class OptionsWindow
	{
		public OptionsWindow()
		{
			this.InitializeComponent();
		}

		private void OnCancelButtonClick(object sender, RoutedEventArgs e)
		{
			Settings.Current.Reload();
			this.Close();
		}

		private void OnOKButtonClick(object sender, RoutedEventArgs e)
		{
			Settings.Current.Password = this.passwordBox.Password;
			Settings.Current.Save();

			Logger.Instance.AddRecord("Settings changed.");

			this.Close();
		}

		private void OnWindowLoaded(object sender, RoutedEventArgs e)
		{
			this.passwordBox.Password = Settings.Current.Password;
		}
	}
}